package com.vip.jwt.controller;


import com.vip.jwt.common.entity.R;
import com.vip.jwt.entity.Permission;
import com.vip.jwt.service.RolePermissionService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 角色权限关联表 前端控制器
 * </p>
 *
 * @author vip
 * @since 2021-05-04
 */
@RestController
@RequestMapping("/api/role/permission")
public class RolePermissionController {

    @Resource
    private RolePermissionService rolePermissionService;

    @GetMapping("/{roleId}")
    public Object findByRoleId(@PathVariable String roleId){
        List<String> permissionIds = rolePermissionService.findByRoleId(roleId);
        return R.ok().data("data",permissionIds);
    }

}

